﻿/*
 * 赋值运算符
 * 
 *      给变量进行赋值的运算符
 */
namespace 赋值运算符
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int a = 10, b = 20;

            a += b;//a = a + b;

            b -= a;//b = b - a;

            a *= b;//a = a * b;

            a /= b;//a = a / b;  

            a %= b;//a = a % b;  a除以b的余数代入到a；

            a <<= 2;//a = a << 2;

            a >>= 2;//a = a >> 2;

            a &= 2;// a = a & 2;

            a |= 2;//a = a | 2;

            a ^= 2;//a ^ 2;

            Console.WriteLine("sizeof(int) is " + sizeof(int));
            Console.WriteLine("sizeof(double) is " + sizeof(double));
            Console.WriteLine("sizeof(byte) is " + sizeof(byte));
            Console.WriteLine("sizeof(short) is " + sizeof(short));
            Console.WriteLine("sizeof(long) is " + sizeof(long));
            Console.WriteLine("sizeof(float) is " + sizeof(float));
            Console.WriteLine("sizeof(char) is " + sizeof(char));


        }
    }
}